feat(wildlife): Cat NPC behavior system - sit/groom/sprint states (#142)#146
Merged
putersdcat merged 7 commits intomainfrom Feb 17, 2026
Merged
Conversation
- Extended SpeciesDef with behaviorWeights and interactLines fields - Three cat species (orange, black, persian) with unique behavior profiles - New behavior states: sit (squished idle), groom (sparkle particles), sprint (burst) - Weighted behavior transitions from idle via pickIdleBehavior() - Walkability checking for wildlife movement (isWalkableAt) - Custom cat interaction dialog lines (not generic 'You spotted a...') - Grooming sparkle particle rendering on canvas - Sitting visual squish (scaleY: 0.85) - Sprint animation bouncing offset - Playwright E2E tests: 7 tests covering species presence, behavior states, interaction lines, dialog rendering, behavior weights, performance All tests pass: cat-behaviors (7/7), wildlife (6/6), tsc --noEmit clean.
…ters (#138) - Moved cassette player from sidebar to floating popup (🎵 HUD button toggle) - Removed LLM config from sidebar, consolidated to Options overlay only - Added API Key field to Options LLM config section - Fixed broken LLM settings sync in showOptionsOverlay() - Added mini status meters (⚡💧🧼) visible when sidebar collapsed - Updated cassette-ui tests to open popup before checking elements - Updated music tests to open popup before clicking play button - New E2E test suite: 12 tests for all #138 changes (all pass) - Regression: cassette-ui 4/4, alpha-qol 15/15, fog-toggle 7/7 - tsc --noEmit clean
10 tasks
…ed ambience (#108) - Terrain-aware footsteps: surface detection via MICRO_TILE_DEFS, plays footstep_grass/dirt/stone samples with pitch variation and cadence throttle - Positional audio: PannerNode-based spatial audio for campfire and water tiles, distance-based start/stop with chunk scanning every 120 frames - Enhanced ambience: sampled loops (cricket/wind/rain) layered on top of oscillator ambience, auto-switching with weather/time-of-day - Animal calls: random bird chirps (day), owl hoots + frog croaks (night), rooster crow on dawn transition - 12 new E2E tests (all passing), 0 regressions on existing 18 SFX tests
17 tasks
- 5-stage pipeline: fetch → normalize → dedupe → validate → write - Adapter pattern: manual (existing curated content), opentdb (API + offline cache) - SHA-256 content-hash deduplication (removed 39 real duplicates) - Safety filtering for children's content (unsafe term detection) - Schema v1 validation with category/difficulty/ageBand checks - ID preservation for existing content (no breaking ID changes) - Provenance metadata on all items for audit trail - CLI: npm run content:pipeline [--adapters=manual,opentdb] [--offline] [--validate-only] - Output: sharded JSON (100 quizzes/shard, 50 articles/shard) + manifest.json - Content pack upgraded to v2.0.0 (381 quizzes, 30 articles after dedup) - 10 new E2E tests, all 87 education tests pass
- Deterministic QA: Flesch-Kincaid readability, safety terms, answer consistency - Reading level presets: early-reader (5-7), elementary (8-10), pre-teen (11-12+) - Authoring LLM client (separate from game BitNet, OpenAI-compatible) - Batch rephraser with dry-run mode (prompt generation without LLM) - Markdown + JSON QA report generator - CLI: --qa, --rephrase, --dry-run, --target-age flags - 11/11 new E2E tests, 98/98 education tests pass
- GitHub Actions workflow: validate, QA, rephrase dry-run, review gate - Triggers: manual dispatch, push/PR (content paths), weekly schedule - Fail conditions: schema errors and QA errors block merge - Artifacts: validation + QA reports uploaded for review - PR template with human review checklist + recovery docs - Safety check refinement: context-aware terms (blood OK in anatomy) - 21/21 new tests, 119/119 education tests pass
- Recursive descent expression parser (browser-compatible, zero deps) - Basic arithmetic (+, -, *, /, ^) with parentheses - Input normalization: fractions, percentages, commas, unit stripping - Deterministic validation with rubric + tolerance - Feature flag: ?freeresponse=1 URL param or localStorage - canUseFreeResponse() gate: math category + numeric answer only - Common-mistake feedback support - 20/20 new tests, 139/139 education tests pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cat NPC Behavior System (#142)
Implements comprehensive behavior system for 3 cat species with unique personalities and interactions.
What Changed
New Behavior States
isWalkableAt()collision checkingSpecies Behavior Weights
Custom Interaction Lines
Each cat species has 3 unique dialog lines replacing the generic "You spotted a..." text. Lines are randomly selected per interaction.
Rendering Enhancements
Testing
tests/gameplay/cat-behaviors.spec.ts)Files Changed
src/config/wildlife.config.ts— ExtendedSpeciesDef, species definitionssrc/wildlife.ts— Behavior engine, walkability, transitionssrc/main.ts— Rendering enhancements, dialog integrationtests/gameplay/cat-behaviors.spec.ts— E2E testsCloses #142